package controller;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import service.Util;

import com.sun.org.apache.xml.internal.serializer.utils.Utils;

@SuppressWarnings("serial")
public class MyipServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/html");
		
		String ip = req.getParameter("ip");
		
		String content = Util.GetHtml("http://whatismyipaddress.com/ip/"+ip, "utf-8");
		resp.getWriter().println(content);
	}
}
